---
layout: m1x_soap
title: Account Create
---

<h3><a name="giftcard_account.create-Module%3AGiftCardAPI"></a>Module: GiftCard API</h3>

<h4><a name="giftcard_account.create-Resource%3Agiftcardaccount"></a>Resource: giftcard_account</h4>


<h5><a name="giftcard_account.create-Method%3A"></a>Method:</h5>

<ul>
	<li>giftcard_account.create (SOAP V1)</li>
	<li>giftcardAccountCreate (SOAP V2)</li>
</ul>


<p>Allows you to create a new gift card account.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> array </td>
<td> giftcardAccountData </td>
<td> Array of giftcardAccountCreateGiftcardAccountData </td>
</tr>
<tr>
<td> array </td>
<td> notificationData </td>
<td> Array of giftcardAccountCreateNotificationData (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> ID of the created gift card account </td>
</tr>
</tbody></table>


<p>The <b>giftcardAccountCreateGiftcardAccountData</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> status <br class="atl-forced-newline" /> </td>
<td> Gift card status: available, used, redeemed, expired </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> date_expires <br class="atl-forced-newline" /> </td>
<td> Gift card expiration date in the YYYY-MM-DD format <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> website_id <br class="atl-forced-newline" /> </td>
<td> Gift card website ID <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> balance <br class="atl-forced-newline" /> </td>
<td> Initial gift card balance <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> state <br class="atl-forced-newline" /> </td>
<td> State: active or not active </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> is_redeemable <br class="atl-forced-newline" /> </td>
<td> Defines whether the gift card is redeemable </td>
</tr>
</tbody></table>


<p>The <b>giftcardAccountCreateNotificationData</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> recipient_name <br class="atl-forced-newline" /> </td>
<td> Recipient name </td>
</tr>
<tr>
<td> string </td>
<td> recipient_email <br class="atl-forced-newline" /> </td>
<td> Recipient email address </td>
</tr>
<tr>
<td> string </td>
<td> recipient_store <br class="atl-forced-newline" /> </td>
<td> Recipient store </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 105 </td>
<td> Provided gift card account data is invalid. </td>
</tr>
<tr>
<td> 104 </td>
<td> Provided email notification data is invalid </td>
</tr>
</tbody></table>


<h4><a name="giftcard_account.create-Examples"></a>Examples</h4>

<h5><a name="giftcard_account.create-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$giftcardToCreate = array(
    "status" =&gt; 'available',
    "is_redeemable" =&gt; 1,
    "balance" =&gt; 200,
    "website_id" =&gt; 2,
    "date_expires" =&gt; null
);

$giftcardId = $proxy-&gt;call(
    $sessionId,
    "giftcard_account.create",
    array(
         $giftcardToCreate
    )
);</pre>
		</div>
</div></div>


<h5><a name="giftcard_account.create-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); 
 
$result = $proxy-&gt;giftcardAccountCreate($sessionId, array(
'status' =&gt; 'available', 
'date_expires' =&gt; null, 
'website_id' =&gt; '2', 
'balance' =&gt; '200', 
'state' =&gt; '1', 
'is_redeemable' =&gt; '1'), 
array(
'recipient_name' =&gt; 'name', 
'recipient_email' =&gt; 'email', 
'recipient_store' =&gt; null)
);   

var_dump($result);</pre>
		</div>
</div></div>



<h5><a name="giftcard_account.create-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;giftcardAccountCreate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'giftcardAccountData' =&gt; array(
'status' =&gt; 'available', 
'date_expires' =&gt; null, 
'website_id' =&gt; '2', 
'balance' =&gt; '200', 
'state' =&gt; '1', 
'is_redeemable' =&gt; '1'), 
'notificationData' =&gt; array(
'recipient_name' =&gt; 'name', 
'recipient_email' =&gt; 'email', 
'recipient_store' =&gt; null)
));   

var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<?php include(__ROOT__ . 'footer.php'); ?>
